package allrobots.TraceAndAvoid;

import t10086.Data.Map.TextCoordinate;

public class Octree implements Comparable<Octree>{
    TextCoordinate pos;
    int forwardCost;
    int towardCost;
    Octree parent;

    public Octree(TextCoordinate pos) {
        this.pos = pos;
        this.parent = null;
        this.forwardCost = 0;
        this.towardCost = 0;
    }

    @Override
    public int compareTo(Octree o) {
        if (o == null) return -1;
        if (forwardCost + towardCost > o.forwardCost + o.towardCost) {
            return 1;
        } else if (forwardCost + towardCost < o.forwardCost + o.towardCost) {
            return -1;
        }
        return 0;
    }
}